package com.wcl.demo.utils;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.wcl.demo.R;

/**
 * Created by dllo on 15/11/17.
 */
public class ToastUtils {
    private static ToastUtils toastUtils;

    public static ToastUtils getInstance() {
        if (toastUtils == null) {
            toastUtils = new ToastUtils();
        }
        return toastUtils;
    }

    public static boolean isShow = true;

    /**
     * 短时间显示Toast
     *
     * @param context
     * @param character
     */
    public static void showShort(Context context, Character character) {
        if (isShow)
            Toast.makeText(context, character, Toast.LENGTH_SHORT).show();
    }

    /**
     * 长时间显示Toast
     *
     * @param context
     * @param character
     */
    public static void showLong(Context context, Character character) {
        if (isShow)
            Toast.makeText(context, character, Toast.LENGTH_SHORT).show();
    }

    /**
     * 自定义时间显示Toast
     *
     * @param context
     * @param character
     * @param duration
     */
    public static void showTime(Context context, Character character, int duration) {
        if (isShow)
            Toast.makeText(context, character, duration).show();
    }

}
